
import java.util.Arrays;
import java.util.PriorityQueue;
import java.util.Scanner;

public class Test3 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();
       // int[] arr = {2, 8, 4, 10, 11};
        int[] arr = new int[n];
        long sum = 0;
        for (int i = 0; i < n; i++) {
            arr[i] = sc.nextInt();
            sum+=arr[i];
        }
        int[] ou = new int[n];
        int j = 0;
        for (int i = 0; i < n; i++) {
            if (arr[i] % 2 == 0) ou[j++] = arr[i];
        }
        for (int i = 0; i < k; i++) {
            Arrays.sort(ou);
            int t = 0;
            for (int l = n-1; l >= 0 ; l--) {
                if (ou[l] % 2 == 0){
                    t = ou[l] / 2;
                    ou[l] /= 2;
                    break;
                }
            }
            sum -= t;
        }
        System.out.println(sum);
    }
}

